﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace cs3202_HW06
{
    /**
     * Creates a form with six text fields, six labels for those fields, and a 
     * button that when clicked brings up a second form with the information 
     * from the fields formatted in a label.
     * 
     * @author Lewis Willimas
     * @version 2011.3.21
     */
    public partial class LabelCreatorForm : Form
    {
        public LabelCreatorForm()
        {
            InitializeComponent();
        }

        /**
         * Creates the LabelDisplayForm and adds a label containing the properly
         * formatted in put from the text boxes on the LabelCreatorForm.
         */
        private void createLabelButton_Click(object sender, EventArgs e)
        {
            Form labelDiplay = new LabelDisplayForm();
            Label informationLabel = new System.Windows.Forms.Label();

            informationLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
            informationLabel.AutoSize = true;
            informationLabel.Location = new System.Drawing.Point(29, 88);
            informationLabel.Font = new System.Drawing.Font("Arial", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            informationLabel.Name = "informationLabel";
            informationLabel.Size = new System.Drawing.Size(35, 13);
            informationLabel.TabIndex = 0;
            informationLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            informationLabel.Text = firstNameTextBox.Text + " " + lastNameTextBox.Text + "\n"
                                    + streetTextBox.Text 
                                    + "\n" + cityTextBox.Text + ", " + stateTextBox.Text + " " + zipCodeTextBox.Text;
            

            labelDiplay.Controls.Add(informationLabel);
            labelDiplay.Show();

        }
    }
}
